import request from '@/utils/request_zc'

export function getProductInspectionList ({
  serialNo,
  completionNo,
  planNo,
  jobName,
  productName,
  inspectionBatch,
  productStartDate,
  productEndDate,
  inspectionItem,
  inspectionResult,
  inspector,
  inspectionStartDate,
  inspectionEndDate,
  page, limit }) {
  return request({
    url: '/mes/product/inspection/list',
    method: 'get',
    params: {
      serialNo,
      completionNo,
      planNo,
      jobName,
      productName,
      inspectionBatch,
      productStartDate,
      productEndDate,
      inspectionItem,
      inspectionResult,
      inspector,
      inspectionStartDate,
      inspectionEndDate,
      page,
      limit
    }
  })
}

export function getissueList () {
  return request({
    url: '/material/issue/list',
    method: 'get'
  })
}

export function editProductInspection ({
  completionId,
  id,
  inspectionResult,
  inspectionValue,
  remark,
  samplingQuantity,
  standardId,
}) {
  return request({
    url: '/mes/product/inspection/edit',
    method: 'post',
    data: {
      completionId,
      id,
      inspectionResult,
      inspectionValue,
      remark,
      samplingQuantity,
      standardId
    }
  })
}

export function addProductInspection ({
  completionId,
  inspectionResult,
  inspectionValue,
  remark,
  samplingQuantity,
  standardId
}) {
  return request({
    url: '/mes/product/inspection/add',
    method: 'post',
    data: {
      completionId,
      inspectionResult,
      inspectionValue,
      remark,
      samplingQuantity,
      standardId
    }
  })
}


export function delProductInspection ({ ids }) {
  return request({
    url: '/mes/product/inspection/del',
    method: 'post',
    data: {
      ids
    }
  })
}

export function getComletionList () {
  return request({
    url: '/mes/product/completion/list',
    method: 'get'
  })
}


export function getStandardList () {
  return request({
    url: '/mes/inspection/standard/list',
    method: 'get'
  })
}